package light.head.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;


/**
 * 入库明细表
 *
 */
@Entity
@Table
public class InStockItem implements Serializable {
	
	private static final long serialVersionUID = -8003613883215913818L;
	
	private Integer code;	
	private Integer gc;			//入库物品名称(从库存表选择名称)
	private Integer count;			// 入库数量
	private Integer sc;				//入库编号
	private Integer price;			//价格（原值）

	private Boolean deleted;
	private String gn;

	
	
	
	

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}

	@Column(length = 10)
	public Integer getCount() {
		return count;
	}

	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Column
	public Integer getGc() {
		return gc;
	}
	public Integer getSc() {
		return sc;
	}

	public Integer getPrice() {
		return price;
	}
	
	
	@Formula("(SELECT g.name FROM Goods g WHERE g.code = gc)")
	public String getGn() {
		return gn;
	}
	
	
	

	

	public void setGn(String gn) {
		this.gn = gn;
	}

	public void setCode(Integer code) {
		this.code = code;
	}


	public void setCount(Integer count) {
		this.count = count;
	}

	public void setSc(Integer sc) {
		this.sc = sc;
	}

	public void setPrice(Integer price) {
		this.price = price;
	}

	public void setGc(Integer gc) {
		this.gc = gc;
	}

	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}

}
